![]() |
MPAllocateTaskStorageIndex |
||||
Header: | Multiprocessing.h | Carbon status: | Supported | |
Returns an index number to access per-task storage.
OSStatus MPAllocateTaskStorageIndex ( TaskStorageIndex *index );
On return, index contains an index number you can use to store task data.
A result code.
A call to the function MPAllocateTaskStorageIndex returns an index number that is common across all tasks in the current process. You can use this index number in calls to MPSetTaskStorageValue and MPGetTaskStorageValue to set a different value for each task using the same index.
You can think of the task storage area as a two dimensional array cross-referenced by the task storage index number and the task ID. Note that since the amount of per-task storage is determined when the task is created, the number of possible index values associated with a task is limited.
Also see the function MPDeallocateTaskStorageIndex.
Introduced with Multiprocessing Services 2.0.
Supported in Carbon. Available in CarbonLib 1.0 and later when MPLibrary 2.0 or later is installed. Exported by CarbonLib 1.0 and later and by MPLibrary 2.0 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)